package com.singlemountain.gcommerce.domain.user;

import com.singlemountain.gcommerce.domain.address.Addressd;
import com.singlemountain.gcommerce.domain.base.Base;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class Userd extends Base {

    @NotNull
    @Column(unique = true)
    private String email;

    private String password;

    private String companyName;

    private String gaeId;

    private Boolean isAdmin;

    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn@OrderBy("isPrimary desc")
    private Set<Addressd> addressSet = new HashSet<Addressd>();

    private String title;

    private String firstName;

    private String lastName;
}
